//
//  MailViewController.m
//  iWeddingDirectory
//
//  Created by apple on 7/19/12.
//  Copyright (c) 2012 Home. All rights reserved.
//

#import "MailViewController.h"
#import "Mail.h"

@interface MailViewController ()

@end

@implementation MailViewController
@synthesize mail;
@synthesize txtDate, txtFrom, txtMessage, txtSubject;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.title = @"Message";
        mail = [[Mail alloc] init];
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    txtSubject.text = mail.title;
    txtFrom.text = mail.from;
    txtDate.text = mail.datecreated;
    txtMessage.text = mail.content;
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(void) dealloc
{
    [mail release];
    [super dealloc];
}

@end
